import service from ".";
import qs from 'qs'
const loginApi = {
    //员工和管理员登录
    login(username, password, capath, capathID){
        const params  = {
            username:username,
            password:password,
            capath:capath,
            capathID:capathID
        }
        return service.post('/login',qs.stringify(params))
    },
    //用户登录
    userLogin(eusername,epassword,capath, capathID){
        const params = {
            eusername:eusername,
            epassword:epassword,
            capath:capath,
            capathID:capathID
        }
        return service.post('/loginuser',qs.stringify(params))
    },//验证码获取
    getCapath(){
        return service.get('/capath');
    },
    // 管理员信息
    getAdminInfo(){
        return service.get('/admin/userInfo');
    },
    //用户修改密码
    updatePassword(username,  password,  newPassword,  confirmPassword){
        const params = {
            username:username,
            password:password,
            newPassword:newPassword,
            confirmPassword:confirmPassword
        }
        return service.put('/updatePassword',qs.stringify(params))
    },
}
export default loginApi;